import { createStore } from 'vuex'
import {useCookies} from "@vueuse/integrations/useCookies";

export default createStore({
  state: {
    videoUrl: null,
    videoType:null,
    loginIndex:useCookies().get("user-token")
  },
  getters: {
    getUrl(state){
      return state.videoUrl
    },
    getLoginIndex(state){
      return state.loginIndex
    }
  },
  mutations: {
    setUrl(state,videoUrl){
      state.videoUrl = videoUrl
    },
    setLoginIndex(state,loginIndex){
      state.loginIndex = loginIndex
    }
  },
  actions: {
    actionUrl({commit},videoUrl){
      commit('setUrl',videoUrl)
    },
    activeLoginIndex({commit},loginIndex){
      commit('setLoginIndex',loginIndex)
    }
  },
  modules: {
  }
})
